package com.demo01;

public class Demo01 {
    public static void main(String[] args) throws ClassNotFoundException {
//        Class c = Object.class;
//        c.getClassLoader();
//        Class
//        Method
//        Constructor
//        Field
        //获取CLass对象的三种方式
        //方式1：通过Object的getClass()方法
        Person p = new Person();
        Class c = p.getClass();
        //方式2：通过类名.class 获取到字节码文件对象
        Class c2 = Person.class;
        //方式3：通过Class类中的forName()方法
        Class c3 = Class.forName("com.demo01.Person");
        System.out.println("c = " + c);
        System.out.println("c2 = " + c2);
        System.out.println("c3 = " + c3);
        System.out.println(c == c2);
        System.out.println(c == c3);
    }
}
